/*
* Copyright 2025 NXP
* NXP Proprietary. This software is owned or controlled by NXP and may only be used strictly in
* accordance with the applicable license terms. By expressly accepting such terms or by downloading, installing,
* activating and/or otherwise using the software, you are agreeing that you have read, and that you agree to
* comply with and are bound by, such license terms.  If you do not agree to be bound by the applicable license
* terms, then you may not retain, install, activate or otherwise use the software.
*/

#include "lvgl.h"
#include <stdio.h>
#include "gui_guider.h"
#include "events_init.h"
#include "widgets_init.h"
#include "custom.h"



void setup_scr_screen_set(lv_ui *ui)
{
    //Write codes screen_set
    ui->screen_set = lv_obj_create(NULL);
    ui->g_kb_screen_set = lv_keyboard_create(ui->screen_set);
    lv_obj_add_event_cb(ui->g_kb_screen_set, kb_event_cb, LV_EVENT_ALL, NULL);
    lv_obj_add_flag(ui->g_kb_screen_set, LV_OBJ_FLAG_HIDDEN);
    lv_obj_set_style_text_font(ui->g_kb_screen_set, &lv_font_SourceHanSerifSC_Regular_18, LV_PART_MAIN|LV_STATE_DEFAULT);
    lv_obj_set_size(ui->screen_set, 240, 320);
    lv_obj_set_scrollbar_mode(ui->screen_set, LV_SCROLLBAR_MODE_OFF);

    //Write style for screen_set, Part: LV_PART_MAIN, State: LV_STATE_DEFAULT.
    lv_obj_set_style_bg_opa(ui->screen_set, 0, LV_PART_MAIN|LV_STATE_DEFAULT);

    //Write codes screen_set_list_set
    ui->screen_set_list_set = lv_list_create(ui->screen_set);
    ui->screen_set_list_set_item0 = lv_list_add_btn(ui->screen_set_list_set, LV_SYMBOL_HOME, "Time and Date");
    ui->screen_set_list_set_item1 = lv_list_add_btn(ui->screen_set_list_set, LV_SYMBOL_WIFI, "WLAN");
    ui->screen_set_list_set_item2 = lv_list_add_btn(ui->screen_set_list_set, LV_SYMBOL_BLUETOOTH, "BlueTooth");
    lv_obj_set_pos(ui->screen_set_list_set, 0, 0);
    lv_obj_set_size(ui->screen_set_list_set, 240, 320);
    lv_obj_set_scrollbar_mode(ui->screen_set_list_set, LV_SCROLLBAR_MODE_OFF);

    //Write style state: LV_STATE_DEFAULT for &style_screen_set_list_set_main_main_default
    static lv_style_t style_screen_set_list_set_main_main_default;
    ui_init_style(&style_screen_set_list_set_main_main_default);

    lv_style_set_pad_top(&style_screen_set_list_set_main_main_default, 48);
    lv_style_set_pad_left(&style_screen_set_list_set_main_main_default, 10);
    lv_style_set_pad_right(&style_screen_set_list_set_main_main_default, 10);
    lv_style_set_pad_bottom(&style_screen_set_list_set_main_main_default, 5);
    lv_style_set_bg_opa(&style_screen_set_list_set_main_main_default, 255);
    lv_style_set_bg_color(&style_screen_set_list_set_main_main_default, lv_color_hex(0x2f92da));
    lv_style_set_bg_grad_dir(&style_screen_set_list_set_main_main_default, LV_GRAD_DIR_NONE);
    lv_style_set_border_width(&style_screen_set_list_set_main_main_default, 0);
    lv_style_set_radius(&style_screen_set_list_set_main_main_default, 0);
    lv_style_set_shadow_width(&style_screen_set_list_set_main_main_default, 0);
    lv_obj_add_style(ui->screen_set_list_set, &style_screen_set_list_set_main_main_default, LV_PART_MAIN|LV_STATE_DEFAULT);

    //Write style state: LV_STATE_DEFAULT for &style_screen_set_list_set_main_scrollbar_default
    static lv_style_t style_screen_set_list_set_main_scrollbar_default;
    ui_init_style(&style_screen_set_list_set_main_scrollbar_default);

    lv_style_set_radius(&style_screen_set_list_set_main_scrollbar_default, 0);
    lv_style_set_bg_opa(&style_screen_set_list_set_main_scrollbar_default, 255);
    lv_style_set_bg_color(&style_screen_set_list_set_main_scrollbar_default, lv_color_hex(0xffffff));
    lv_style_set_bg_grad_dir(&style_screen_set_list_set_main_scrollbar_default, LV_GRAD_DIR_NONE);
    lv_obj_add_style(ui->screen_set_list_set, &style_screen_set_list_set_main_scrollbar_default, LV_PART_SCROLLBAR|LV_STATE_DEFAULT);

    //Write style state: LV_STATE_DEFAULT for &style_screen_set_list_set_extra_btns_main_default
    static lv_style_t style_screen_set_list_set_extra_btns_main_default;
    ui_init_style(&style_screen_set_list_set_extra_btns_main_default);

    lv_style_set_pad_top(&style_screen_set_list_set_extra_btns_main_default, 8);
    lv_style_set_pad_left(&style_screen_set_list_set_extra_btns_main_default, 13);
    lv_style_set_pad_right(&style_screen_set_list_set_extra_btns_main_default, 8);
    lv_style_set_pad_bottom(&style_screen_set_list_set_extra_btns_main_default, 8);
    lv_style_set_border_width(&style_screen_set_list_set_extra_btns_main_default, 1);
    lv_style_set_border_opa(&style_screen_set_list_set_extra_btns_main_default, 255);
    lv_style_set_border_color(&style_screen_set_list_set_extra_btns_main_default, lv_color_hex(0x2F35DA));
    lv_style_set_border_side(&style_screen_set_list_set_extra_btns_main_default, LV_BORDER_SIDE_FULL);
    lv_style_set_text_color(&style_screen_set_list_set_extra_btns_main_default, lv_color_hex(0x0D3055));
    lv_style_set_text_font(&style_screen_set_list_set_extra_btns_main_default, &lv_font_montserratMedium_17);
    lv_style_set_text_opa(&style_screen_set_list_set_extra_btns_main_default, 255);
    lv_style_set_radius(&style_screen_set_list_set_extra_btns_main_default, 7);
    lv_style_set_bg_opa(&style_screen_set_list_set_extra_btns_main_default, 255);
    lv_style_set_bg_color(&style_screen_set_list_set_extra_btns_main_default, lv_color_hex(0x2FDAAE));
    lv_style_set_bg_grad_dir(&style_screen_set_list_set_extra_btns_main_default, LV_GRAD_DIR_NONE);
    lv_obj_add_style(ui->screen_set_list_set_item2, &style_screen_set_list_set_extra_btns_main_default, LV_PART_MAIN|LV_STATE_DEFAULT);
    lv_obj_add_style(ui->screen_set_list_set_item1, &style_screen_set_list_set_extra_btns_main_default, LV_PART_MAIN|LV_STATE_DEFAULT);
    lv_obj_add_style(ui->screen_set_list_set_item0, &style_screen_set_list_set_extra_btns_main_default, LV_PART_MAIN|LV_STATE_DEFAULT);

    //Write style state: LV_STATE_DEFAULT for &style_screen_set_list_set_extra_texts_main_default
    static lv_style_t style_screen_set_list_set_extra_texts_main_default;
    ui_init_style(&style_screen_set_list_set_extra_texts_main_default);

    lv_style_set_pad_top(&style_screen_set_list_set_extra_texts_main_default, 5);
    lv_style_set_pad_left(&style_screen_set_list_set_extra_texts_main_default, 5);
    lv_style_set_pad_right(&style_screen_set_list_set_extra_texts_main_default, 5);
    lv_style_set_pad_bottom(&style_screen_set_list_set_extra_texts_main_default, 5);
    lv_style_set_border_width(&style_screen_set_list_set_extra_texts_main_default, 0);
    lv_style_set_text_color(&style_screen_set_list_set_extra_texts_main_default, lv_color_hex(0x0D3055));
    lv_style_set_text_font(&style_screen_set_list_set_extra_texts_main_default, &lv_font_montserratMedium_12);
    lv_style_set_text_opa(&style_screen_set_list_set_extra_texts_main_default, 255);
    lv_style_set_radius(&style_screen_set_list_set_extra_texts_main_default, 0);
    lv_style_set_transform_width(&style_screen_set_list_set_extra_texts_main_default, 0);
    lv_style_set_bg_opa(&style_screen_set_list_set_extra_texts_main_default, 255);
    lv_style_set_bg_color(&style_screen_set_list_set_extra_texts_main_default, lv_color_hex(0xffffff));
    lv_style_set_bg_grad_dir(&style_screen_set_list_set_extra_texts_main_default, LV_GRAD_DIR_NONE);

    //Write codes screen_set_label_set
    ui->screen_set_label_set = lv_label_create(ui->screen_set);
    lv_label_set_text(ui->screen_set_label_set, " 设置");
    lv_label_set_long_mode(ui->screen_set_label_set, LV_LABEL_LONG_SCROLL_CIRCULAR);
    lv_obj_set_pos(ui->screen_set_label_set, 84, 12);
    lv_obj_set_size(ui->screen_set_label_set, 60, 27);

    //Write style for screen_set_label_set, Part: LV_PART_MAIN, State: LV_STATE_DEFAULT.
    lv_obj_set_style_border_width(ui->screen_set_label_set, 0, LV_PART_MAIN|LV_STATE_DEFAULT);
    lv_obj_set_style_radius(ui->screen_set_label_set, 0, LV_PART_MAIN|LV_STATE_DEFAULT);
    lv_obj_set_style_text_color(ui->screen_set_label_set, lv_color_hex(0x000000), LV_PART_MAIN|LV_STATE_DEFAULT);
    lv_obj_set_style_text_font(ui->screen_set_label_set, &lv_font_SourceHanSerifSC_Regular_24, LV_PART_MAIN|LV_STATE_DEFAULT);
    lv_obj_set_style_text_opa(ui->screen_set_label_set, 255, LV_PART_MAIN|LV_STATE_DEFAULT);
    lv_obj_set_style_text_letter_space(ui->screen_set_label_set, 2, LV_PART_MAIN|LV_STATE_DEFAULT);
    lv_obj_set_style_text_line_space(ui->screen_set_label_set, 0, LV_PART_MAIN|LV_STATE_DEFAULT);
    lv_obj_set_style_text_align(ui->screen_set_label_set, LV_TEXT_ALIGN_CENTER, LV_PART_MAIN|LV_STATE_DEFAULT);
    lv_obj_set_style_bg_opa(ui->screen_set_label_set, 255, LV_PART_MAIN|LV_STATE_DEFAULT);
    lv_obj_set_style_bg_color(ui->screen_set_label_set, lv_color_hex(0x2F92DA), LV_PART_MAIN|LV_STATE_DEFAULT);
    lv_obj_set_style_bg_grad_dir(ui->screen_set_label_set, LV_GRAD_DIR_NONE, LV_PART_MAIN|LV_STATE_DEFAULT);
    lv_obj_set_style_pad_top(ui->screen_set_label_set, 0, LV_PART_MAIN|LV_STATE_DEFAULT);
    lv_obj_set_style_pad_right(ui->screen_set_label_set, 0, LV_PART_MAIN|LV_STATE_DEFAULT);
    lv_obj_set_style_pad_bottom(ui->screen_set_label_set, 0, LV_PART_MAIN|LV_STATE_DEFAULT);
    lv_obj_set_style_pad_left(ui->screen_set_label_set, 0, LV_PART_MAIN|LV_STATE_DEFAULT);
    lv_obj_set_style_shadow_width(ui->screen_set_label_set, 0, LV_PART_MAIN|LV_STATE_DEFAULT);

    //Write codes screen_set_imgbtn_back
    ui->screen_set_imgbtn_back = lv_imgbtn_create(ui->screen_set);
    lv_obj_add_flag(ui->screen_set_imgbtn_back, LV_OBJ_FLAG_CHECKABLE);
    lv_imgbtn_set_src(ui->screen_set_imgbtn_back, LV_IMGBTN_STATE_RELEASED, NULL, &_back_alpha_47x40, NULL);
    lv_imgbtn_set_src(ui->screen_set_imgbtn_back, LV_IMGBTN_STATE_PRESSED, NULL, &_back_alpha_47x40, NULL);
    ui->screen_set_imgbtn_back_label = lv_label_create(ui->screen_set_imgbtn_back);
    lv_label_set_text(ui->screen_set_imgbtn_back_label, "");
    lv_label_set_long_mode(ui->screen_set_imgbtn_back_label, LV_LABEL_LONG_WRAP);
    lv_obj_align(ui->screen_set_imgbtn_back_label, LV_ALIGN_CENTER, 0, 0);
    lv_obj_set_style_pad_all(ui->screen_set_imgbtn_back, 0, LV_STATE_DEFAULT);
    lv_obj_set_pos(ui->screen_set_imgbtn_back, 4, 0);
    lv_obj_set_size(ui->screen_set_imgbtn_back, 47, 40);

    //Write style for screen_set_imgbtn_back, Part: LV_PART_MAIN, State: LV_STATE_DEFAULT.
    lv_obj_set_style_text_color(ui->screen_set_imgbtn_back, lv_color_hex(0x000000), LV_PART_MAIN|LV_STATE_DEFAULT);
    lv_obj_set_style_text_font(ui->screen_set_imgbtn_back, &lv_font_montserratMedium_12, LV_PART_MAIN|LV_STATE_DEFAULT);
    lv_obj_set_style_text_opa(ui->screen_set_imgbtn_back, 255, LV_PART_MAIN|LV_STATE_DEFAULT);
    lv_obj_set_style_text_align(ui->screen_set_imgbtn_back, LV_TEXT_ALIGN_CENTER, LV_PART_MAIN|LV_STATE_DEFAULT);
    lv_obj_set_style_radius(ui->screen_set_imgbtn_back, 0, LV_PART_MAIN|LV_STATE_DEFAULT);
    lv_obj_set_style_clip_corner(ui->screen_set_imgbtn_back, true, LV_PART_MAIN|LV_STATE_DEFAULT);
    lv_obj_set_style_shadow_width(ui->screen_set_imgbtn_back, 0, LV_PART_MAIN|LV_STATE_DEFAULT);

    //Write style for screen_set_imgbtn_back, Part: LV_PART_MAIN, State: LV_STATE_PRESSED.
    lv_obj_set_style_img_recolor_opa(ui->screen_set_imgbtn_back, 255, LV_PART_MAIN|LV_STATE_PRESSED);
    lv_obj_set_style_img_recolor(ui->screen_set_imgbtn_back, lv_color_hex(0xffffff), LV_PART_MAIN|LV_STATE_PRESSED);
    lv_obj_set_style_img_opa(ui->screen_set_imgbtn_back, 255, LV_PART_MAIN|LV_STATE_PRESSED);
    lv_obj_set_style_text_color(ui->screen_set_imgbtn_back, lv_color_hex(0xFF33FF), LV_PART_MAIN|LV_STATE_PRESSED);
    lv_obj_set_style_text_font(ui->screen_set_imgbtn_back, &lv_font_montserratMedium_12, LV_PART_MAIN|LV_STATE_PRESSED);
    lv_obj_set_style_text_opa(ui->screen_set_imgbtn_back, 255, LV_PART_MAIN|LV_STATE_PRESSED);
    lv_obj_set_style_shadow_width(ui->screen_set_imgbtn_back, 0, LV_PART_MAIN|LV_STATE_PRESSED);

    //Write style for screen_set_imgbtn_back, Part: LV_PART_MAIN, State: LV_STATE_CHECKED.
    lv_obj_set_style_img_recolor_opa(ui->screen_set_imgbtn_back, 0, LV_PART_MAIN|LV_STATE_CHECKED);
    lv_obj_set_style_img_opa(ui->screen_set_imgbtn_back, 255, LV_PART_MAIN|LV_STATE_CHECKED);
    lv_obj_set_style_text_color(ui->screen_set_imgbtn_back, lv_color_hex(0xFF33FF), LV_PART_MAIN|LV_STATE_CHECKED);
    lv_obj_set_style_text_font(ui->screen_set_imgbtn_back, &lv_font_montserratMedium_12, LV_PART_MAIN|LV_STATE_CHECKED);
    lv_obj_set_style_text_opa(ui->screen_set_imgbtn_back, 255, LV_PART_MAIN|LV_STATE_CHECKED);
    lv_obj_set_style_shadow_width(ui->screen_set_imgbtn_back, 0, LV_PART_MAIN|LV_STATE_CHECKED);

    //Write style for screen_set_imgbtn_back, Part: LV_PART_MAIN, State: LV_IMGBTN_STATE_RELEASED.
    lv_obj_set_style_img_recolor_opa(ui->screen_set_imgbtn_back, 0, LV_PART_MAIN|LV_IMGBTN_STATE_RELEASED);
    lv_obj_set_style_img_opa(ui->screen_set_imgbtn_back, 255, LV_PART_MAIN|LV_IMGBTN_STATE_RELEASED);

    //The custom code of screen_set.


    //Update current screen layout.
    lv_obj_update_layout(ui->screen_set);

    //Init events for screen.
    events_init_screen_set(ui);
}
